The present invention relates to debugging of machine-executable code, and more particularly to avoiding or mitigating resource contention when debugging.
The present invention further relates to a computer program product comprising computer-readable program code that enables a processor of a processing system to implement a method for controlling debug processing.
It is known to execute debug processing to collect data for the purpose of analyzing and resolving a software problem. This may be done at a thread-specific level of granularity such that machine-executable code enters a “thread-specific debugging state”. When in a thread-specific debugging state, data collection (for problem analysis and resolution) is enabled, but restricted to specific thread(s) at which the debugging state is directed.
One approach to triggering debug processing is to use tokens (included in a client request that requests a computer operation to be performed) to cause the processor that performs the requested computer operation to enter a “thread-specific-debug state” where debug information is collected and logged from some threads running on the processor, but not necessarily from all threads running on the processor. This approach may enable a developer to debug an application while other users remain free to use the application (via other threads, for example).
However, there may be processes within a running application that may cause a resource lock and subsequent resource contention. This may be undesirable, since it may impact other users of the application. For example, instances that may cause a lock contention include, but are not limited to: (i) a mutual exclusion (mutex) that protects access to an object—if the debugger acquires the mutex, then all other requests to access the object are blocked while waiting to acquire the same mutex; and (ii) a read/write lock that protects access to an object—if the debug process acquires a write lock, then all other requests are blocked while waiting to acquire a read or write lock.
Accordingly, the consequence of impacting other users when executing debug processing of a live application cannot be ignored. It may therefore be desirable to control debug processing so as to mitigate or eliminate such resource contentions.